package com.qd.common.panda.domain.entity.carpark;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;


/**
 * 收益设置
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class CarParkRevenueDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "收益ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "收益ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String rid;
    /**
     * 天数/小时
     */
    @NotNull(message = "天数/小时不能为空", groups = DefaultGroup.class)
    private Integer days;
    /**
     * 日/每小时收益
     */
    @NotNull(message = "日/每小时收益不能为空", groups = DefaultGroup.class)
    private BigDecimal dayRevenue;
    /**
     * 日/每小时收益显示
     */
    private String dayRevenueDisplay;
    /**
     * 总收益
     */
    private BigDecimal totalRevenue;
    /**
     * 总收益显示
     */
    private String totalRevenueDisplay;
    /**
     * 停车场标识
     */
    @Size(max = 50, message = "停车场标识长度不能超过{max}位", groups = DefaultGroup.class)
    private String pId;
    /**
     * 租赁类型
     */
    @NotBlank(message = "租赁类型不能为空", groups = DeleteGroup.class)
    @Size(max = 50, message = "租赁类型长度不能超过{max}位", groups = DefaultGroup.class)
    private String leaseType;
    /**
     * 租赁类型显示
     */
    private String leaseTypeDisplay;

    @Override
    public void freeData() {
        this.rid = null;
        this.days = null;
        this.dayRevenue = null;
        this.dayRevenueDisplay = null;
        this.totalRevenue = null;
        this.totalRevenueDisplay = null;
        this.pId = null;
        this.leaseType = null;
        this.leaseTypeDisplay = null;
        super.freeData();
    }
}
